<template>
	<div>
		<div class="pub-title">后台管理</div>
		<ul class="pub-tab">
			<li class="option-list">
				<a href="article.html" class="option on">文章</a>
				<!-- <a href="article_classify.html" class="option">分类</a> -->
			</li>
			<li class="tab-block-list">
				<div class="head-tip">
					<input type="text" class="pub-input" v-model="mobile" placeholder="手机号" />
					<button class="pub-btn" @click="search">搜索</button>
					<a class="pub-btn" href="member_detail.html?type=add">+新增会员</a>
				</div>
				<div class="pub-empty" v-show="list.length<1">暂无数据</div>
				<table class="pub-table">
					<tr>
						<th width="80">序号</th>
						<th>用户手机</th>
						<th>是否冻结</th>
						<th>注册时间</th>
						<th width="300">操作</th>
					</tr> 
					<tr class="checkbox" v-for="(v,k) in list">
						<td>{{k+1}}</td>
						<td>{{v.mobile}}</td>
						<td>{{v.disabled==0?'正常':'禁止'}}</td>
						<td>{{date(v.create_time)}}</td>
						<td> 
							<a :href="'member_detail.html?id='+v._id" class="pub-btn">编辑会员信息</a>
						</td>
					</tr>

					<!-- <tr class="last">
						<td><input type="checkbox" /> 全选</td>
						<td colspan="5">

						</td>
					</tr> -->

				</table>
			</li>
		</ul>
	</div>
</template>
<script>
	module.exports = {
		data: function() {
			return {
				mobile:'',
				list: [],
			}
		},
		methods: {
			search(){
				var data=""
				data+='mobile='+this.mobile;
				location.href='member.html?'+data;
			},
			date:function(s){
				return vm.formatDate(s)
			},
			getList() {
				let data={
					mobile:this.mobile?this.mobile:"",
					page:0
				};
				ajax({
					url:"member/getList",
					type:'get',
					data:data,
					success:function(res){
						if(res.state==1){
							_this.list=res.data.list;
						}else{
							UI.alert(res.msg);
						}
					}
				})
			}
		},
		created() {
			_this=this;
			this.getList();
		}
	}
</script>
